/**
 * store 公共继承模块
 */
export default function storeExtend(...stores) {
    const base = { 
        namespaced: true,
        state: {}, 
        getters: {},
        mutations: {}, 
        actions: {}
    };

    const store = stores.reduce((acc, extend) => {
      //合并state
      Object.assign(acc.state, extend.state);
      //合并mutations
      Object.assign(acc.mutations, extend.mutations);
      //合并actions
      Object.assign(acc.actions, extend.actions);
      //合并getters
      Object.assign(acc.getters, extend.getters);
      return acc;
    }, base);

    return store;
};